#ifndef RAY_H
#define RAY_H

#include "Vector.h"

class PArray;
class Triangle;
class TopologicalModel;

class Ray
{
public:
	Vector3 origin_;
	Vector3 dir_;
	Ray();
	Vector3 Point(Real) const;
};

class TriIntersection
{
public:
	Triangle * victim_;
	Real distance_;
	Ray ray_;

	Vector3 Point() const;
	TriIntersection();
};

TriIntersection IntersectTriangles(Ray ray, TopologicalModel *mod, bool dyn);
bool IntersectTriangleWithRay(Vector3 const*v, Ray ray, Real *dist);
void BarycentricCoordinates(Vector3 const * vertices, Real *coef, Vector3 x);


#endif